//**********************************************************************
//  PP5_1.java   Author: Tang Caiming
//
//  输入1582之后的整数，确定其是否为闰年.
//**********************************************************************

import java.util.Scanner;

public class PP5_1
{
   //-------------------------------------------------------------------
   //  计算某一年是否为闰年.
   //-------------------------------------------------------------------
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);
      int year;

      System.out.println("Enter a number of the year: ");
      year = scan.nextInt();

      if (year < 1582)
         System.out.println("Error, the Gregorian calendar has not been "
                             + "used in this year.");
      else
          //  年份被4整除且不能被100整除（年份能同时被100和400整除）
          if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))
             System.out.println("This year is a leap year.");
          else
             System.out.println("This year is not a leap year.");
   }
} 
